<!DOCTYPE html>
<html>
  <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
      <title>会员中心</title>
      {include file="public/link" /}
      <style type="text/css">
        .layui-table-body{
            overflow: hidden;
        }
        html{
          background: #efefef;
        }
        body{
          background: #efefef;
        }
        .height2{
          background: #efefef;
        }
      </style>
  </head>
  <body>

    <div class="maincont">
     {include file="public/user_head" /}


      <div class="height2"></div>
      <div class="vle_order_list" style="padding: 0 15px;">
        <form class="layui-form layui-form-pane" action="">
        <input type="hidden" name="id" value="{$user.id}">
          <div class="layui-form-item">
            <label class="layui-form-label">名称</label>
            <div class="layui-input-inline">
              <input type="text" name="username" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" value="{$user.username}">
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">出生年月日</label>
            <div class="layui-input-inline">
              <input type="text" name="borndate" id="date" lay-verify="date" placeholder="YYYY-MM-dd" autocomplete="off" class="layui-input"  value="{$user.borndate}" >
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">绑定手机</label>
            <div class="layui-input-inline">
              <input type="text"  lay-verify="required|phone" autocomplete="off" class="layui-input" value="{$user.telphone}"  disabled="disabled">
            </div>
          </div>
          <div class="layui-form-item" pane="">
            <label class="layui-form-label" >性别</label>
            <div class="layui-input-block" style="background: #fff;left: 0px;">
              <input type="radio" name="sex" value="1" title="男" {if condition="$user.sex == '1'"} checked="" {/if}>
              <input type="radio" name="sex" value="2" title="女" {if condition="$user.sex == '2'"} checked="" {/if}>
            </div>
          </div>
          <div class="layui-form-item">
            <div class="layui-input-block">
              <button class="layui-btn" lay-submit="" lay-filter="demo1">修改</button>
              <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
          </div>

          
        </form>
      </div>






     <div class="lrSub">
       <a href="{:url('user/index')}">返回会员中心</a>
     </div>
     
     <div class="height1"></div>
     {include file="public/footnav" /}
    </div><!--maincont-->
  
    <script src="{$Assets}layui/layui.js?t=1515376178709"></script>

<script>
layui.use(['form', 'layedit', 'laydate','layer'], function(){ 
  var $ = layui.jquery, layer = layui.layer; 
    var form = layui.form
  ,layer = layui.layer
  ,layedit = layui.layedit
  ,laydate = layui.laydate;
  

    //日期
  laydate.render({
    elem: '#date'
  });

  //监听提交
  form.on('submit(demo1)', function(data){
    


      var save_set = JSON.stringify(data.field);

                      $.ajax({
                        type:"POST",
                        url: "{:url('user/setsave')}",
                        data:{data:save_set},
                        dataType:"json",

                        success:function(ret_datas){
                            if(ret_datas==1){
                                layer.msg('修改成功!');
                            }else if(ret_datas==99){
                                layer.msg('修改异常，请重新操作');
                            }else{
                                layer.msg(ret_datas);
                            }
                            setTimeout("location.reload();",1000);
                        }
                    });
    return false;
  });




  
  $('.vle_order_list .layui-btn').on('click', function(){
    var othis = $(this), method = othis.data('method');
    active[method] ? active[method].call(this, othis) : '';
  });
  
});
</script>




    {include file="public/footer" /}
  </body>
  
</html>